home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2005 November / WNnov2005.iso / Windows / Equipement / hMailServer / hMailServer-4.1-Build-136.exe / {app} / PHPWebAdmin / frontpage.php < prev    next >
PHP Script  |  2005-01-06  |  3KB  |  78 lines

  1. <?php
  2. /*
  3. ** $Id: frontpage.php,v 1.3 2005/01/05 22:22:50 hmailserver Exp $
  4. **
  5. **    hMailServer - Web interface
  6. **
  7. **    File formatted using TAB size 4
  8. **
  9. **    Get hMailserver at http://www.hmailserver.com
  10. **
  11. **    Author: Steen Rab°l <srabol@mail.tele.dk>
  12. **    Copyright (c) 2004, Steen Rab°l <srabol@mail.tele.dk>
  13. **
  14. **  This program is free software; you can redistribute it and/or modify
  15. **  it under the terms of the GNU General Public License as published by
  16. **  the Free Software Foundation; either version 2 of the License, or
  17. **  (at your option) any later version.
  18. **
  19. **  You may not change or alter any portion of this comment or credits
  20. **  of supporting developers from this source code or any supporting
  21. **  source code which is considered copyrighted (c) material of the
  22. **  original comment or credit authors.
  23. **
  24. **  This program is distributed in the hope that it will be useful,
  25. **  but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27. **  GNU General Public License for more details.
  28. **
  29. **  You should have received a copy of the GNU General Public License
  30. **  along with this program; if not, write to the Free Software
  31. **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  32. **
  33. */
  34.  
  35. // Collect some information
  36.  
  37. $obSettings        = $obBaseApp->Settings();
  38. $obDatabase        = $obBaseApp->Database();
  39. $serverstate    = $obBaseApp->ServerState();
  40.  
  41. switch($serverstate)
  42. {
  43.     case 1: $server_info['serverstate']    = hmailGetLocaleText("server_stopped"); break;
  44.     case 2: $server_info['serverstate']    = hmailGetLocaleText("server_startpending"); break;
  45.     case 3: $server_info['serverstate']    = hmailGetLocaleText("server_running"); break;
  46.     case 4: $server_info['serverstate']    = hmailGetLocaleText("server_stoppending"); break;
  47.     default: $server_info['serverstate']    = hmailGetLocaleText("server_unknownstate"); break;
  48. }
  49.  
  50. $server_info['smtp_server'] = ($obSettings->ServiceSMTP == true ? hmailGetLocaleText("enabled") : hmailGetLocaleText("disabled"));
  51. $server_info['pop3_server'] = ($obSettings->ServicePOP3 == true ? hmailGetLocaleText("enabled") : hmailGetLocaleText("disabled"));
  52. $server_info['imap_server'] = ($obSettings->ServiceIMAP == true ? hmailGetLocaleText("enabled") : hmailGetLocaleText("disabled"));
  53. $obDomains    = $obBaseApp->Domains();
  54. $server_info['domain_count']    = $obDomains->Count();
  55. $server_info['accounts_count']    = 0;
  56. $server_info['alias_count']    = 0;
  57. $server_info['distributionlists_count']    = 0;
  58.  
  59. $DomainCount = $obBaseApp->Domains->Count();
  60. for ($i = 1; $i <= $DomainCount; $i++)
  61. {
  62.     $obDomain = $obBaseApp->Domains[$i-1];
  63.     $obAccounts             = $obDomain->Accounts();
  64.     $obAliases                = $obDomain->Aliases();
  65.     $obDistributionLists    = $obDomain->DistributionLists();
  66.     $server_info['accounts_count']    += $obAccounts->Count();
  67.     $server_info['alias_count']    += $obAliases->Count();
  68.     $server_info['distributionlists_count']    += $obDistributionLists->Count();
  69. }
  70. $server_info['version']    = $obBaseApp->Version();
  71. $hmailSmarty->assign("server_info",$server_info);
  72.  
  73. if (hmailGetAdminLevel() == 2)
  74.     $hmailSmarty->assign("pagecontent", $hmailSmarty->fetch('frontpage_admin.tpl'));
  75. else
  76.     $hmailSmarty->assign("pagecontent", $hmailSmarty->fetch('frontpage.tpl'));
  77.  
  78. ?>